<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMenuTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('permissions', function (Blueprint $table) {
            $table->increments('id');
            $table->string('type');
            $table->string('name')->nullable();//菜单名称
            $table->boolean('available')->default(true);//是否可用
            $table->string('route')->nullable();//路由名称
            $table->string('icon')->nullable();//菜单图形class
            $table->integer('level')->default(0);//层级
            $table->string('remark')->nullable();//备注
            $table->integer('sort')->default(99);//排序
            $table->integer('pid')->nullable();//父节点
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('permissions');
    }
}
